<?php

declare(strict_types=1);

namespace App\CustHub\Model;

use Hyperf\Database\Model\Relations\HasMany;
use Mine\MineModel;

/**
 * @property int $id 
 * @property int $uid 
 * @property int $main_uid 
 * @property string $group_name 分组名称
 * @property string $created_at 
 * @property-read null|\Hyperf\Database\Model\Collection|ChAddFriend[] $friends 
 */
class ChAddFriendGroup extends MineModel
{
    public bool $timestamps = false;
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ch_add_friend_group';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'uid', 'main_uid', 'group_name', 'created_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'uid' => 'integer', 'main_uid' => 'integer'];
    public function friends(): HasMany
    {
        return $this->hasMany(ChAddFriend::class, 'group_id', 'id');
    }
}
